package feign.ethan.springCloud.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * RocketMq 消费者
 * @author Ethan
 */
@Slf4j
@RocketMQMessageListener(consumerGroup = "${rocketmq.consumer.group}",topic = "springBoot-rocketmq")
@Component
public class ConsumerService implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        log.warn("收到消息啦!!!!!");
        log.info("===>>>> {}", s);
    }
}